<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <div id="test">

    <!-- 
      使用v-for遍历数组
      用法: v-for="item in 数组"    "(item, index) in 数组"   同时指定key: :key="item.id"

     -->
    <ul>
      <!-- <li v-for="p in persons"> -->
      <li v-for="(p,index) in persons" :key="p.id">
        {{index+1}}: {{p.id}} -- {{p.name}} -- {{p.age}}
      </li>
    </ul>
  </div>

  <script src="../js/vue.js"></script>
  <script>
    new Vue({
      el: "#test",
      data: {
        persons: [
          {id: 3, name: 'Tom', age: 14},
          {id: 5, name: 'Jack', age: 15},
          {id: 7, name: 'Bob', age: 13},
        ]
      }
    })
  </script>
</body>
</html>